import constant from "./constant";
export default {

  zoom() {
    let oBody = document.getElementsByTagName('div')[0];


    /*寬高同時縮放不同比例*/

    let xWidth= window.innerWidth>=1024?window.innerWidth:1024;//寬度最小1024
    let yHeight= window.innerHeight>=576?window.innerHeight:576;//調試最小576

    let x = xWidth / constant.constant.PAGE_WIDTH;
    let y = yHeight / constant.constant.PAGE_HEIGHT;

    oBody.style.transform = `scale(${x}, ${y})`;
    oBody.style.webkitTransform = `scale(${x}, ${y})`;// for Chrome || Safari
    oBody.style.msTransform = `scale(${x}, ${y})`;// for Firefox
    oBody.style.mozTransform = `scale(${x}, ${y})`;// for IE
    oBody.style.oTransform = `scale(${x}, ${y})`;// for Opera


    /*寬高縮放同樣比例*/
    /*
    let x = window.innerWidth / constant.constant.PAGE_WIDTH;
    x= x<0.5?0.5:x;
    oBody.style.transform = `scale(${x})`;
    oBody.style.webkitTransform = `scale(${x})`;// for Chrome || Safari
    oBody.style.msTransform = `scale(${x})`;// for Firefox
    oBody.style.mozTransform = `scale(${x})`;// for IE
    oBody.style.oTransform = `scale(${x})`;// for Opera
    */
  }
};
